﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace JewererBasic.Models
{
    public class HistoryTool
    {
        public int IdBill { get; set; }
        public string IdTool { get; set; }
        public string IdCreater { get; set; }
        public int Quantity { get; set; }
        public string Reason { get; set; }
        public DateTime Time { get; set; }
        public string Type { get; set; }
        public int Price { get; set; }
        public int TotalCost { get; set; }

        public HistoryTool(TOOL_IMPORT ti, TOOL_IMPORT_DETAIL tid)
        {
            IdBill = ti.Id;
            IdTool = tid.IdTool;
            IdCreater = ti.Creator;
            Quantity = tid.Quantity;
            Reason = tid.Reason;
            Type = "Import";
            Time = (DateTime)ti.DayMake;
            Price = tid.Price;
            TotalCost = tid.TotalCost;
        }

        public HistoryTool(TOOL_EXPORT ti, TOOL_EXPORT_DETAIL tid)
        {
            IdBill = ti.Id;
            IdTool = tid.IdTool;
            IdCreater = ti.Creator;
            Quantity = tid.Quantity;
            Reason = tid.Reason;
            Type = "Export";
            Time = (DateTime)ti.DayMake;
            Price = tid.Price;
            TotalCost = tid.TotalCost;
        }
    }
}